﻿using System;

namespace ShenLan.Common
{
    public class ClearTextClass
    {
        /// <summary>
        /// 过滤非法字符 by shenlanit.com
        /// </summary>
        /// <param name="text">要过滤的字符串</param>
        /// <returns>过滤后的字符串</returns>
        public static string ClearBadText(string text)
        {
            text = text.Replace("~", "");
            text = text.Replace("`", "");
            text = text.Replace("@", "");
            //text = text.Replace("#", "");
            text = text.Replace("$", "");
            //text = text.Replace("%", "");
            text = text.Replace("^", "");
            //text = text.Replace("&", "");
            text = text.Replace("*", "");
            text = text.Replace("{", "");
            text = text.Replace("}", "");
            text = text.Replace("[", "");
            text = text.Replace("]", "");
            text = text.Replace("<", "");
            text = text.Replace(">", "");
            text = text.Replace("/", "");
            return text;
        }
    }
}